/*
 Navicat Premium Data Transfer

 Source Server         : mysql5.7-3306
 Source Server Type    : MySQL
 Source Server Version : 50727
 Source Host           : localhost:3306
 Source Schema         : live

 Target Server Type    : MySQL
 Target Server Version : 50727
 File Encoding         : 65001

 Date: 22/12/2019 20:29:44
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admins
-- ----------------------------
DROP TABLE IF EXISTS `admins`;
CREATE TABLE `admins` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `account` varchar(32) NOT NULL COMMENT '账号',
  `password` varchar(32) NOT NULL COMMENT '密码',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员表';

-- ----------------------------
-- Records of admins
-- ----------------------------
BEGIN;
INSERT INTO `admins` VALUES (1, 'admin', 'e28125f4b3c57501d02e0469b8aaa5c1');
COMMIT;

-- ----------------------------
-- Table structure for categories
-- ----------------------------
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `cat_name` varchar(32) NOT NULL COMMENT '分类名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='分类表';

-- ----------------------------
-- Records of categories
-- ----------------------------
BEGIN;
INSERT INTO `categories` VALUES (4, 'Node.js');
INSERT INTO `categories` VALUES (5, 'MySQL5.7');
INSERT INTO `categories` VALUES (6, 'MongoDB');
INSERT INTO `categories` VALUES (7, 'Antd');
INSERT INTO `categories` VALUES (8, 'Vue');
INSERT INTO `categories` VALUES (9, 'React');
INSERT INTO `categories` VALUES (12, 'ElementUI');
INSERT INTO `categories` VALUES (13, '数据库');
INSERT INTO `categories` VALUES (14, '购物指南');
COMMIT;

-- ----------------------------
-- Table structure for gifts
-- ----------------------------
DROP TABLE IF EXISTS `gifts`;
CREATE TABLE `gifts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `gift_name` varchar(32) NOT NULL COMMENT '礼物名称',
  `gift_icon` varchar(128) NOT NULL COMMENT '礼物图标',
  `price` decimal(10,2) unsigned NOT NULL COMMENT '礼物价格',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='礼物表';

-- ----------------------------
-- Records of gifts
-- ----------------------------
BEGIN;
INSERT INTO `gifts` VALUES (1, '手机', 'https://img20.360buyimg.com/jdcms/s300x300_jfs/t1/50018/39/8127/229510/5d5b5043E66769ff0/8907776f7bd66d57.jpg.webp', 324.30);
INSERT INTO `gifts` VALUES (2, '面包', 'http://127.0.0.1:8765/uploads/20191215/1576412663199.jpg', 809.43);
INSERT INTO `gifts` VALUES (3, '电脑', 'http://127.0.0.1:8765/uploads/20191215/1576412440292.jpg', 5000.00);
INSERT INTO `gifts` VALUES (4, '显示器', 'http://127.0.0.1:8765/uploads/20191215/1576412479948.jpg', 3900.00);
COMMIT;

-- ----------------------------
-- Table structure for lives
-- ----------------------------
DROP TABLE IF EXISTS `lives`;
CREATE TABLE `lives` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `user_id` int(10) unsigned NOT NULL COMMENT '主播ID',
  `addtime` int(10) unsigned NOT NULL COMMENT '创建时间戳',
  `push_url` varchar(255) NOT NULL COMMENT '推流地址',
  `pull_url` varchar(255) NOT NULL COMMENT '拉流地址',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='直播表';

-- ----------------------------
-- Records of lives
-- ----------------------------
BEGIN;
INSERT INTO `lives` VALUES (1, 2, 1577017344, 'rtmp://videopush.wuyinglei.com/user-2/8754?auth_key=1577019144-0-0-b928de6997373a884097628b8b1773d9', 'rtmp://videopull.wuyinglei.com/user-2/8754?auth_key=1577019144-0-0-a6674820d40ec6d2ee7ac0dde44c6bb1');
COMMIT;

-- ----------------------------
-- Table structure for orders
-- ----------------------------
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `addtime` int(10) unsigned NOT NULL COMMENT '充值时间',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户ID',
  `money` decimal(10,2) unsigned NOT NULL COMMENT '充值金额',
  `order_sn` varchar(32) NOT NULL COMMENT '订单编号',
  `pay_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态 0：未支付  1：已支付',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='充值订单表';

-- ----------------------------
-- Table structure for rooms
-- ----------------------------
DROP TABLE IF EXISTS `rooms`;
CREATE TABLE `rooms` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `room_name` varchar(32) NOT NULL COMMENT '直播间名称',
  `room_introduce` varchar(128) NOT NULL COMMENT '直播间描述',
  `user_id` int(10) unsigned NOT NULL COMMENT '主播ID',
  `addtime` int(10) unsigned NOT NULL COMMENT '创建时间',
  `user_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '房间人数',
  `logo` varchar(128) DEFAULT NULL COMMENT '封面图片',
  `play_url` varchar(128) DEFAULT NULL COMMENT '播放地址',
  `category_id` int(10) unsigned NOT NULL COMMENT '分类ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='直播间表';

-- ----------------------------
-- Records of rooms
-- ----------------------------
BEGIN;
INSERT INTO `rooms` VALUES (1, '回锅肉的房间', '回锅肉~~~', 2, 1577017043, 0, NULL, NULL, 14);
COMMIT;

-- ----------------------------
-- Table structure for user_gifts
-- ----------------------------
DROP TABLE IF EXISTS `user_gifts`;
CREATE TABLE `user_gifts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `addtime` int(10) unsigned NOT NULL COMMENT '送礼时间戳',
  `from_id` int(10) unsigned NOT NULL COMMENT '送礼人',
  `to_id` int(10) unsigned NOT NULL COMMENT '收礼人',
  `gift_id` int(10) unsigned NOT NULL COMMENT '礼物ID',
  `price` decimal(10,2) unsigned NOT NULL COMMENT '礼物价格',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户礼物表';

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `mobile` char(11) NOT NULL COMMENT '手机号码',
  `avatar` varchar(128) DEFAULT NULL COMMENT '头像',
  `name` varchar(128) DEFAULT NULL COMMENT '昵称',
  `money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '余额',
  `password` char(32) NOT NULL COMMENT '密码',
  `room_id` int(10) unsigned DEFAULT NULL COMMENT '房间ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户表';

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO `users` VALUES (1, '13344445555', 'http://xxx/xx/xx/xx.jpg', '小鱼儿', 2323.00, '4143720f20c887039887ec04af0d83c1', NULL);
INSERT INTO `users` VALUES (2, '13344445577', NULL, '大师兄', 0.00, '4143720f20c887039887ec04af0d83c1', 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
